package org.example.consumer.controller;

import org.example.consumer.service.BusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class BusinessController {

    @Autowired
    private BusinessService businessService;

    @GetMapping("/buy")
    public String buy(@RequestParam String user,
                      @RequestParam String commodity,
                      @RequestParam int count,
                      @RequestParam int money){
        businessService.purchase(user, commodity, count, money);
        return "ok";
    }
}